package com.glsc.ngateway.common.api.common.dto;

import lombok.Data;
import lombok.NoArgsConstructor;

import java.util.ArrayList;
import java.util.List;

@Data
@NoArgsConstructor
public class PageDto<T> {
    public PageDto(List<T> content, Integer number, Integer size, Long totalElements){
        this.content=content;
        this.number=number;
        this.size=size;
        this.totalElements = totalElements;
    }
    private List<T> content;
    private PageAbleDto pageable = new PageAbleDto();
    boolean last = false;
    long totalElements ;
    int totalPages;
    boolean first = true;
    private SortDto sort;
    int number;
    int numberOfElements;
    int size;
    boolean empty;

    public static <T> PageDto<T> empty(){
        return new PageDto<>(new ArrayList<>(0), 0, 0, 0L);
    }
}
